package com.fortune.service.impl;


import com.fortune.dao.CProductWholesalePriceDao;
import com.fortune.dto.in.cPriceMgt.CPriceAddDto;
import com.fortune.dto.in.cPriceMgt.CPriceEditDto;
import com.fortune.dto.in.cPriceMgt.CPriceListDto;
import com.fortune.dto.in.cPriceMgt.CWholesalePriceDto;
import com.fortune.service.CProductWholesalePriceService;
import com.fortune.vo.cPriceMgt.CClientPrice;
import com.fortune.vo.cPriceMgt.CClientWholesalePrice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CProductWholesalePriceServiceImpl implements CProductWholesalePriceService {
    @Autowired
    private CProductWholesalePriceDao cProductWholesalePriceDao;

    /**
     * 客户批发价列表
     * @param companyId
     * @param dealerId
     * @param listDto
     * @return
     */
    @Override
    public List<CClientPrice> queryProductPriceList(String companyId, String dealerId, CPriceListDto listDto) {
        return cProductWholesalePriceDao.queryProductPriceList(companyId,dealerId,listDto);
    }

    /**
     * 客户批发价列表个数
     * @param companyId
     * @param dealerId
     * @param listDto
     * @return
     */
    @Override
    public int queryProductPriceListCount(String companyId, String dealerId, CPriceListDto listDto) {
        return cProductWholesalePriceDao.queryProductPriceListCount(companyId,dealerId,listDto);
    }

    /**
     * 新增客户批发
     * @param companyId
     * @param dealerId
     * @param addDto
     * @return
     */
    @Override
    public int addProductWholesalePrice(String companyId, String dealerId, CPriceAddDto addDto) {
        return cProductWholesalePriceDao.addProductWholesalePrice(companyId,dealerId,addDto);
    }

    /**
     * 编辑客户批发
     * @param companyId
     * @param dealerId
     * @param editDto
     * @return
     */
    @Override
    public int editProductWholesalePrice(String companyId, String dealerId, CPriceEditDto editDto) {
        return cProductWholesalePriceDao.editProductWholesalePrice(companyId,dealerId,editDto);
    }

    /**
     * 删除客户批发
     * @param companyId
     * @param dealerId
     * @param productId
     * @param clientId
     * @return
     */
    @Override
    public int deleteProductWholesalePrice(String companyId, String dealerId, String productId, String clientId) {
        return cProductWholesalePriceDao.deleteProductWholesalePrice(companyId,dealerId,productId,clientId);
    }

    /**
     * 查询客户统一批发价
     * @param companyId
     * @param dealerId
     * @param cWholesalePriceDto
     * @return
     */
    @Override
    public List<CClientWholesalePrice> queryProductWholesalePriceList(String companyId, String dealerId, CWholesalePriceDto cWholesalePriceDto) {
        return cProductWholesalePriceDao.queryProductWholesalePriceList(companyId,dealerId,cWholesalePriceDto);
    }

    /**
     * 查询客户统一批发价个数
     * @param companyId
     * @param dealerId
     * @param cWholesalePriceDto
     * @return
     */
    @Override
    public int queryProductWholesalePriceListCount(String companyId, String dealerId, CWholesalePriceDto cWholesalePriceDto) {
        return cProductWholesalePriceDao.queryProductWholesalePriceListCount(companyId,dealerId,cWholesalePriceDto);
    }
}
